package pa165.dominatingspecies.service.converter;

import pa165.dominating.species.entities.User;
import pa165.dominating.species.tos.UserTO;

/**
 * @author Tomas Kalla
 */
public class UserConverter {

    public UserTO convertUser2UserTO(final User source) {
        UserTO target = new UserTO();
        target.setId(source.getId());
        target.setLogin(source.getLogin());
        target.setName(source.getName());
        target.setPassword(source.getPassword());
        target.setType(source.getType());

        return target;
    }

    public User convertUserTO2User(final UserTO source) {
        User target = new User();
        target.setId(source.getId());
        target.setLogin(source.getLogin());
        target.setName(source.getName());
        target.setPassword((source.getPassword()));
        target.setType(source.getType());

        return target;
    }
}
